package org.wzl.todolisthelper.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wzl.todolisthelper.service.WXService;
import org.wzl.todolisthelper.utils.Resp;

/**
 * 微信基础接口
 */
@Slf4j
@RestController
@RequestMapping("/wxService")
public class WXServiceController {

    @Resource
    private WXService wxService;

    /**
     * 微信登录接口
     * @param code 微信端code
     * @return 返回token，该token用户用户信息存储
     */
    @SaIgnore
    @GetMapping("/jscode2session")
    public Resp<?> jscode2session(String code) {
        return Resp.ok(wxService.jscode2session(code));
    }

}
